package com.crm.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity 
@Table(name = "clientdet")
public class Clientdet implements Serializable {
	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")
	@Column(name="id")
	private int id;
	
	
	
	@ManyToOne
	@JoinColumn(name="BUSINESS_ID")
	private Business businessId;
	
	private String tell;
	
	
	private String division;

	@Column(name="client_group")
	private String group;
	
	private String email;
	private String website;
	
	private String addr;

	private String fax;
	
	
	private String shrtname;
	
	
	
	
	private String organisation;
	private String orgtype;
	
	private Boolean is_deleted;

	@OneToMany(cascade = CascadeType.ALL)

	@JoinColumn(name = "companyid", referencedColumnName = "id")
	private List<ClientUser> cliuser = new ArrayList<ClientUser>();
	

	
	private static final long serialVersionUID = 1L;

	
	
	
	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public Business getBusinessId() {
		return businessId;
	}

	public void setBusinessId(Business businessId) {
		this.businessId = businessId;
	}

	public String getOrgtype() {
		return orgtype;
	}

	public void setOrgtype(String orgtype) {
		this.orgtype = orgtype;
	}

	public Clientdet() {
		
	}

	

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	

	public List<ClientUser> getCliuser() {
		return cliuser;
	}

	public void setCliuser(List<ClientUser> cliuser) {
		this.cliuser = cliuser;
	}


	
	public String getTell() {
		return this.tell;
	}

	public void setTell(String tell) {
		this.tell = tell;
	}

	
	public String getDivision() {
		return this.division;
	}

	public void setDivision(String division) {
		this.division = division;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	
	public String getAddr() {
		return this.addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}


	public String getShrtname() {
		return this.shrtname;
	}

	public void setShrtname(String shrtname) {
		this.shrtname = shrtname;
	}


	
	public String getOrganisation() {
		return organisation;
	}

	public void setOrganisation(String organisation) {
		this.organisation = organisation;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	

	public Boolean getIs_deleted() {
		return is_deleted;
	}
	
	
	public void setIs_deleted(Boolean is_deleted) {
		this.is_deleted = is_deleted;
	}
	
	
	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}


	public Clientdet(Business busid,String orgName, String compShrtName,String website, String address,
			String division, String tellNumber, String email, String fax,Boolean isDeleted,String group,String orgType) {
		this.businessId=busid;
		this.organisation=orgName;
		this.shrtname=compShrtName;
		this.addr=address;
		this.website=website;
		this.email=email;
		this.division=division;
		this.tell=tellNumber;
		this.fax=fax;
		this.is_deleted=isDeleted;
		this.group=group;
		this.orgtype=orgType;
	}

	@Override
	public String toString(){
		return "Clientdet [Id="+id+",BusinessId="+businessId+", Organisation Name="+organisation+" Short Name="+shrtname+", Website="+website
				+", Address="+addr+",Division="+division+",IsDeleted="+is_deleted+", Email="+email+", Fax="+fax+", Telephoine="+tell+", Group="+group+"]";
	}
}
